import {BaseEntity,Column,Entity,Index,JoinColumn,JoinTable,ManyToMany,ManyToOne,OneToMany,OneToOne,PrimaryColumn,PrimaryGeneratedColumn,RelationId} from "typeorm";


@Entity("mall_user_coupon",{schema:"nest-mall" } )
@Index("user_id",["userId",])
export class MallUserCoupon {

    @PrimaryGeneratedColumn({
        type:"mediumint", 
        name:"id"
        })
    id:number;
        

    @Column("tinyint",{ 
        nullable:true,
        default: () => "'0'",
        name:"coupon_id"
        })
    couponId:number | null;
        

    @Column("varchar",{ 
        nullable:true,
        length:20,
        name:"coupon_number"
        })
    couponNumber:string | null;
        

    @Column("int",{ 
        nullable:true,
        default: () => "'0'",
        name:"user_id"
        })
    userId:number | null;
        

    @Column("datetime",{ 
        nullable:true,
        name:"used_time"
        })
    usedTime:Date | null;
        

    @Column("datetime",{ 
        nullable:true,
        name:"add_time"
        })
    addTime:Date | null;
        

    @Column("mediumint",{ 
        nullable:true,
        default: () => "'0'",
        name:"order_id"
        })
    orderId:number | null;
        

    @Column("varchar",{ 
        nullable:true,
        length:64,
        name:"source_key"
        })
    sourceKey:string | null;
        

    @Column("int",{ 
        nullable:true,
        name:"referrer"
        })
    referrer:number | null;
        

    @Column("tinyint",{ 
        nullable:true,
        default: () => "'1'",
        name:"coupon_status"
        })
    couponStatus:number | null;
        
}
